{extend name="public/base"/} {block name="body"}
<style>
    .mui-row.mui-fullscreen>[class*="mui-col-"] {
        height: 100%;
    }
    .mui-col-xs-3,
    .mui-col-xs-9 {
        overflow-y: auto;
        height: 100%;
    }

    .mui-segmented-control .mui-control-item {
        line-height: 50px;
        width: 100%;
    }

    .mui-control-content {
        display: block;
    }

    .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active {
        background-color: #fff;
    }
    .mui-toast-container {
        bottom: 50%;
        z-index: 999999999999999999;
    }
    .mui-btn-block{
      padding: 5px;
      border: 1px solid #ccc !important;
      margin: 5px;
      -webkit-appearance: none;
    }
    .active .mui-icon{
      display: block !important;
    }
    .submitbuttonqx {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 2.876712rem;
        background-color: red;
        color: #fff;
        text-align: center;
        text-decoration: none;
        font-size: 0.410959rem;
        font-weight: bold;
        line-height: 1.315068rem;
    }
</style>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/checkout.css" />
<header class="mui-bar mui-bar-nav" style="z-index:7">
			<a class="mui-icon mui-icon-left-nav mui-pull-left mui-action-back"></a>
			<h1 class="mui-title">确定订单</h1>
</header>
<div class="mui-content" style="    margin-bottom:60px;">
  <div  class="checkout-section" >
      <section class="cart-address" >
          <div class="address-item"   onclick='window.location.href = "{:url('index/address/index')}"'   {empty name="$address['sex']"}style="display: none;"{/empty}>
              <h2 class="address-name" > <b >{$address.name}</b> <span >{eq name="$address['sex']" value='1'}先生{else /}女士{/eq}</span> <span >{$address.tel}</span> </h2>
              <p class="address-detail" >{$address.address}-{$address.house_number}</p> <span class="mui-icon mui-icon-arrowright"></span>  </div>
          <div class="address-item" onclick='window.location.href = "{:url('index/address/add')}"' {notempty name="$address['sex']"}style="display: none;"{/notempty} > 请添加一个收货地址 <span class="mui-icon mui-icon-arrowright"></span> </div>
      </section>

  <br />
  <section class="cart-group checkout-section">
      <ul class="foodlist" style="    margin: 0;">
            <li> <span class="cellname">{$info.goods_id|get_table_field="id","good_name","goods"}-{$info.rule_name}</span> <span class="cellquantity">x&nbsp;1</span> <span class="celltotal">¥{$info['rule_price']}</span> </li>
      </ul>
    <div class="fee" >
        <div >配送费(约{$address.disparity}公里) 满600全城免运费</div>
        <div id="freight" >¥{$address.freight}</div>


    </div>

    <div class="fee" >
        <div >余额支付</div>
        <div >¥{$Request.session.user.balance}</div>
    </div>

      <div class="total">
          <div> <span>总计 <span id="zj">¥{$info['rule_price']}</span>  余额 ¥{$Request.session.user.balance}</span> &nbsp;&nbsp; </div>
          <span>实付<span style="color:red;" id="sf" class="sjzf"></span></span>
      </div>
  </section>






    <form  method="post"  action="{:url('index/order/add')}">
      <section class="checkout-section">
      <div class="mui-input-row" style="margin: 10px 5px;">
      					<textarea id="textarea" name="remark" rows="5" placeholder="备注"></textarea>
      	</div>
      </section>
      <input type="hidden" name="index_type" value="1"  />
    </form>

  </div>


  <nav class="mui-bar mui-bar-tab" style="   border-bottom: none;  background-color: #3d3d3f; ">
      <span style="    color: #fff;font-size: .48rem;line-height: 1.273333rem;padding-left: .266667rem;">待支付 <span id="dzf" class="sjzf" style="color:red"></span></span>
      <a href="javascript:" class="submitbutton" style="right: 2.876712rem;" >确定下单</a>
      <a  class="submitbuttonqx qxdd" data-url="{:url('index/index')}" >取消订单</a>
  </nav>

</div>

{/block}
{block name="script"}

  <script type="text/javascript">
    $(function(){

    //实际支付价格
    var price = parseFloat("{$info['rule_price']}"), balance = parseFloat("{$Request.session.user.balance}"),sf = '0.00'
    if(price - balance >= 0){
       sf = parseFloat(price - balance).toFixed(2)
    }
    $('.sjzf').text(sf)

    //确定下单
    $('.submitbutton').on('tap', function(){
      $('form').submit()
    })
    //取消订单
    $('.qxdd').on('tap', function(){
     var btnArray = ['否', '是'];
     mui.confirm('您确定要删除该订单吗？', '删除订单', btnArray, function(e) {
        window.location.href = "{:url('index/index')}"
     })
    })



    })




  </script>
{/block}
